<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <div th:replace="authority/user/head"></div>
</head>
<script>
    if (top.window.location.href != window.location.href)
        top.window.location.href = window.location.href;
</script>
<body>

<!--<div th:include="header"></div>-->
<div class="zsa-center">
    <div class="layui-container fly-marginTop">
        <div class="fly-panel fly-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title">
                    <li class="layui-this">登入</li>
                    <!--<li><a th:href="@{/user/to_reg.html}">注册</a></li>-->
                </ul>
                <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form layui-form-pane">
                            <!--/*@thymesVar id="loginUrl" type="java.lang.String"*/-->
                            <form th:action="@{${loginUrl}}" id="my-form" method="post">
                                <!--/*@thymesVar id="reference" type="java.lang.String"*/-->
                                <input type="hidden" name="reference" th:value="${reference}">
                                <div class="layui-form-item">
                                    <label for="L_account" class="layui-form-label">账号</label>
                                    <div class="layui-input-inline">
                                        <!--/*@thymesVar id="account" type="java.lang.String"*/-->
                                        <input type="text" id="L_account" name="account" required lay-verify="required"
                                               autocomplete="off" class="layui-input" th:value="${account}">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="L_password" class="layui-form-label">密码</label>
                                    <div class="layui-input-inline">
                                        <input type="password" id="L_password" name="password" required
                                               lay-verify="required"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <!--<div class="layui-form-item">-->
                                <!--<label class="layui-form-label">人类验证</label>-->
                                <!--<div class="layui-input-inline">-->
                                <!--<div id="code_div" style="width: 100%;position: relative;">-->
                                <!--<div id="captcha1">-->
                                <!--<p id="wait1" class="show"-->
                                <!--style="height: 38px; line-height: 38px; padding-left: 15px">-->
                                <!--正在加载验证码......</p>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--</div>-->
                                <!--<div class="layui-form-mid layui-word-aux">请进行人机验证</div>-->
                                <!--</div>-->
                                <div class="layui-form-item">
                                    <!--/*@thymesVar id="errorMsg" type="java.lang.String"*/-->
                                    <p class="layui-text" style="color: #FF5722;" th:text="${errorMsg}"></p>
                                </div>
                                <div class="layui-form-item">
                                    <button class="layui-btn" id="submit1" lay-filter="submit" lay-submit>立即登录</button>
                                    <span style="padding-left:20px;">
                                  <a th:href="@{/user/to_forget.html}">忘记密码？</a>
                                </span>
                                </div>
                                <!--<div class="layui-form-item fly-form-app">-->
                                <!--<span>或者使用社交账号登入</span>-->
                                <!--<a href="" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})"-->
                                <!--class="iconfont icon-qq" title="QQ登入"></a>-->
                                <!--<a href="" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})"-->
                                <!--class="iconfont icon-weibo" title="微博登入"></a>-->
                                <!--</div>-->
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:replace="authority/common/footer"></div>

<script>
    layui.use(['lutil', 'form'], function () {
        var form = layui.form, lutil = layui.lutil;
        //各种基于事件的操作，下面会有进一步介绍
        form.on('submit(submit)', function (data) {
            // if (!captcha_obj.getValidate()) {
            //     lutil.error_alert("请进行人机验证");
            //     return false;
            // }
            layer.load(2, {shade: [0.3, '#eee']});

            // $('form')[0].submit();
            // $('#submit1').addClass("disable");
            // return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        $("form").keypress(function (e) {
            var code = event.keyCode;
            if (event.which == 13 || event.keyCode == 13) {
                $('#submit1').click();
            }
        });
    });

</script>

</body>
</html>